<?php
require "config.php";
$num = 1000000;
global $CFG;
$beg = time();
$handle = fopen("input.txt","w");
$numGameCode = count($CFG->GameCode)-1;
$numApiName = count($CFG->ApiName)-1;
for ($id = 0; $id < $num; $id++) {
	$date = date("Y/m/d");
	$date .= ' '.rand(0,24).':'.rand(0,60).':'.rand(0,60);
	$game = rand(0,$numGameCode);
	$api = rand(0,$numApiName);
	$dur = rand(50, 30000);
	$str = ($id+1).', '.$date.', '.$CFG->GameCode[$game].', '.$CFG->ApiName[$api].', '.$dur;
	fwrite($handle, $str);
	if ($id < $num-1) fwrite($handle, "\n");
}

$end = time();
$dif = $end - $beg;
echo 'Finish '.$dif;
fclose($handle);